home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / Sample Code / Snippets / Development Tools & Languages / DTSCPlusLibrary / Sources / Tracer.h < prev    next >
Encoding:
Text File  |  1993-01-14  |  1.7 KB  |  64 lines  |  [TEXT/MPS ]

  1. /* _________________________________________________________________________________________________________ //
  2.   Copyright © 1992 Apple Computer, Inc. All rights reserved.
  3.   Macintosh Developer Technical Support.C++ Macintosh Toolbox Framework.
  4.   Originator: Kent Sandvik
  5.   Date: Friday, July 10, 1992 10:14:27
  6.   Revision comments are at the end of this file.
  7.   ---
  8.   TTracer is an example of a stack/heap based tracing class, which could be
  9.   used for tracing memory leaks and keeping track of created objects
  10.   Tracer.h contains the header file information for the initial class construction.
  11.   _________________________________________________________________________________________________________ */
  12.  
  13. // Declare label for this header file
  14. #ifndef _TRACER_
  15. #define _TRACER_
  16.  
  17. #ifndef _DTSCPLUSLIBRARY_
  18. #include "DTSCPlusLibrary.h"
  19. #endif
  20.  
  21. //    Toolbox Include Files
  22. #ifndef __TYPES__
  23. #include <Types.h>
  24. #endif
  25.  
  26.  
  27. #include <stdlib.h>
  28.  
  29. // make use of the ANSI __FILE__ and __LINE__ macros
  30. #define TRACEPOINT __FILE__,__LINE__
  31.  
  32.  
  33. // _________________________________________________________________________________________________________ //
  34. //    Class Interface
  35. class TTracer
  36. {
  37. public:
  38.     //    CONSTRUCTORS & DESTRUCTORS
  39.     TTracer(const char* className,
  40.             const char* file = 0,
  41.             int line = 0);
  42.     virtual~ TTracer();
  43.  
  44. private:
  45.     // FIELDS
  46.     const char* fLabel;
  47.     const char* fFile;
  48.     int fLine;
  49.     static int fReferenceCount;                    // keep track of how many TTracers we construct
  50. };
  51.  
  52.  
  53. #endif
  54.  
  55. // _________________________________________________________________________________________________________ //
  56.  
  57.  
  58. /*    Change History (most recent last):
  59.   No        Init.    Date        Comment
  60.   1            khs        7/10/92        New file
  61. */
  62.  
  63.  
  64.